#!/bin/bash

#touch -t 199501131000 dataMINX

touch /var/run/dataMINX

FOLDERS="/usr/sbin/privatepw
/usr/sbin/pwck
/usr/sbin/go500gw
/usr/bin/fakefile
/sbin/mkreiserfs
/sbin/ypbind"     # List of files you are curious about.
                  # Threw in a dummy file, /usr/bin/fakefile.

func2() {
   if [ -z $1 ]
     # Checks if any params.
     then
       echo "No parameters passed to function."
       return 0
   else
       echo "Param #1 is $1."
   fi
   
   if [ $2 ]
     then
       echo "Parameter #2 is $2."
   fi
}


function processSubfolder() {

   for folder in $1
   do
      if [-d $folder ]
      then
          if [ $folder -nt $dataMINX ] 
          then
              # -nt is "newer than"
              files=`ls $folder`
              processSubfolder($files)
          fi
      elif [-f $folder ]
      then 
          if [ $folder -nt $dataMINX ] 
          then
             # do something with files more modern than $dataMINX
          fi
      fi
   done

}

for folder in $FOLDERS
do
  processSubfolder( $folder)

done

for directory in `find . -type d -maxdepth 1 -mindepth 1 -not -name .svn`
 do
     echo $directory exists here - do something with it
 done

